package bairui.international.controller.personnel.employee;

import com.sh_lianjing.spring.web.controller.enhance.module.*;
import com.sh_lianjing.spring.web.controller.enhance.module.body.*;
import com.sh_lianjing.spring.web.controller.enhance.output.bean.*;
import bairui.international.controller.personnel.employee.C_Personnel_Employee_Add;

/**
 *
 * Module_Add
 *
 */
class Module_Add{

	
	public Module module(
		bairui.international.model.domain.jpa.TB_Admin bean
		, 
		C_Personnel_Employee_Add.Add.Operate c_Personnel_Employee_Add_Add_Operate
				, 
		java.util.List<bairui.international.model.domain.jpa.TB_Department> departments
		,java.util.List<bairui.international.model.domain.jpa.TB_Position> positions
		,com.sh_lianjing.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors
		
	){
		return moduleTemplate(
				bean
				, 
				c_Personnel_Employee_Add_Add_Operate
						, 
				departments
		,		positions
				,editors
			);
	}
	
	public Module module(
		java.util.List<bairui.international.model.domain.jpa.TB_Admin> bean
		, 
		C_Personnel_Employee_Add.Add.Operate c_Personnel_Employee_Add_Add_Operate
				, 
		java.util.List<bairui.international.model.domain.jpa.TB_Department> departments
		,java.util.List<bairui.international.model.domain.jpa.TB_Position> positions
		,com.sh_lianjing.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors
		
	){
		return moduleTemplate(
				bean
				, 
				c_Personnel_Employee_Add_Add_Operate
						, 
				departments
		,		positions
				,editors
			);
	}
	
	public Module module(
	//	, 
	C_Personnel_Employee_Add.Add.Operate c_Personnel_Employee_Add_Add_Operate
			, 
	java.util.List<bairui.international.model.domain.jpa.TB_Department> departments
	,java.util.List<bairui.international.model.domain.jpa.TB_Position> positions
	,com.sh_lianjing.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors
	
	){
		Object bean = null;
		return moduleTemplate(
				bean
				, 
				c_Personnel_Employee_Add_Add_Operate
						, 
				departments
		,		positions
				,editors
			);
	}
	
	/**
	 * 编辑模块
	 */
	private Module moduleTemplate(
		Object bean
		, 
		C_Personnel_Employee_Add.Add.Operate c_Personnel_Employee_Add_Add_Operate
				, 
		java.util.List<bairui.international.model.domain.jpa.TB_Department> departments
		,java.util.List<bairui.international.model.domain.jpa.TB_Position> positions
		,com.sh_lianjing.spring.web.controller.enhance.input.InputModelContextMethodInfoEditor ... editors
		
	){
		return
			new Module(
					new ModuleHead("添加")
					, 
					new AddModuleBody(
							bean, 
							Model.class,
							c_Personnel_Employee_Add_Add_Operate, 
							Relation.relations(
									departments
	,								positions
								)
							,editors
						)
				);
	}
	
	/**
	 * 输入模型
	 */
	static public class Models {
		private @lombok.Getter @lombok.Setter java.util.List<Model> models = new java.util.ArrayList<>();
	}
	
	@org.springframework.stereotype.Component("bairui.international.controller.personnel.employee.Module_Add$Model")
	
	static public class Model
	
	 extends bairui.international.model.domain.jpa.TB_Admin
	
	 implements 
	
		com.sh_lianjing.spring.web.controller.enhance.input.InputModelable
	
	{
	
	
	
		/**
	
		 * 默认构造函数
	
		 */
	
		public Model(){}
	
	
	
		/**
	
		 * 构造函数
	
		 */
	
		public Model(
	
			bairui.international.model.domain.jpa.TB_Admin bean
	
		){
	
			if(null != bean){
	
				this.setName(bean.getName());
	
				this.setNumber(bean.getNumber());
	
				this.setMobilePhone(bean.getMobilePhone());
	
				this.setState(bean.getState());
	
				this.setMail(bean.getMail());
	
				this.setFixedPhone(bean.getFixedPhone());
	
				this.setGender(bean.getGender());
	
				this.setDepartments(bean.getDepartments());
	
				this.setPositions(bean.getPositions());
	
			}
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("姓名")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(1001)
	
		@org.hibernate.validator.constraints.NotBlank
	
		@javax.validation.constraints.Size(min=0, max=255)
	
		@Override
	
		public String getName() {
	
			return (String)super.getName();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("工号")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(2001)
	
		@org.hibernate.validator.constraints.NotBlank
	
		@javax.validation.constraints.Size(min=0, max=255)
	
		@com.sh_lianjing.validate.data.Unique(domainType=bairui.international.model.domain.jpa.TB_Admin.class)
	
		@Override
	
		public String getNumber() {
	
			return (String)super.getNumber();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("手机号")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(3001)
	
		@org.hibernate.validator.constraints.NotBlank
	
		@javax.validation.constraints.Size(min=0, max=255)
	
		@com.sh_lianjing.validate.generic.Phone
	
		@com.sh_lianjing.validate.data.Unique(domainType=bairui.international.model.domain.jpa.TB_Admin.class)
	
		@Override
	
		public String getMobilePhone() {
	
			return (String)super.getMobilePhone();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("状态")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(4001)
	
		@javax.validation.constraints.NotNull
	
		@Override
	
		public bairui.international.model.status.State_Employee getState() {
	
			return (bairui.international.model.status.State_Employee)super.getState();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("邮箱")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(5001)
	
		@javax.validation.constraints.Size(min=0, max=255)
	
		@org.hibernate.validator.constraints.Email
	
		@com.sh_lianjing.validate.data.Unique(domainType=bairui.international.model.domain.jpa.TB_Admin.class)
	
		@Override
	
		public String getMail() {
	
			return (String)super.getMail();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("固定电话")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(6001)
	
		@javax.validation.constraints.Size(min=0, max=255)
	
		@com.sh_lianjing.validate.generic.Phone
	
		@Override
	
		public String getFixedPhone() {
	
			return (String)super.getFixedPhone();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("性别")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(7001)
	
		@javax.validation.constraints.NotNull
	
		@Override
	
		public bairui.international.model.type.Type_Gender getGender() {
	
			return (bairui.international.model.type.Type_Gender)super.getGender();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("部门")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(8001)
	
		@Override
	
		public java.util.List<bairui.international.model.domain.jpa.TB_Department> getDepartments() {
	
			return (java.util.List<bairui.international.model.domain.jpa.TB_Department>)super.getDepartments();
	
		}
	
		
	
	
	
		@com.sh_lianjing.model.annotation.Comment("职位")
	
		@com.sh_lianjing.reflect.method.annotation.MethodOrder(9001)
	
		@Override
	
		public java.util.List<bairui.international.model.domain.jpa.TB_Position> getPositions() {
	
			return (java.util.List<bairui.international.model.domain.jpa.TB_Position>)super.getPositions();
	
		}
	
		
	
	
	
		/**
	
		 * 非继承属性
	
		 */
	
	
	
		/**
	
		 * 得到输入属性
	
		 */
	
		/** 得到姓名 */
	
		public String gainName() {
	
			return this.getName();
	
		}
	
		/** 得到工号 */
	
		public String gainNumber() {
	
			return this.getNumber();
	
		}
	
		/** 得到手机号 */
	
		public String gainMobilePhone() {
	
			return this.getMobilePhone();
	
		}
	
		/** 得到状态 */
	
		public bairui.international.model.status.State_Employee gainState() {
	
			return this.getState();
	
		}
	
		/** 得到邮箱 */
	
		public String gainMail() {
	
			return this.getMail();
	
		}
	
		/** 得到固定电话 */
	
		public String gainFixedPhone() {
	
			return this.getFixedPhone();
	
		}
	
		/** 得到性别 */
	
		public bairui.international.model.type.Type_Gender gainGender() {
	
			return this.getGender();
	
		}
	
		/** 得到部门 */
	
		public java.util.List<bairui.international.model.domain.jpa.TB_Department> gainDepartments() {
	
			return this.getDepartments();
	
		}
	
		/** 得到职位 */
	
		public java.util.List<bairui.international.model.domain.jpa.TB_Position> gainPositions() {
	
			return this.getPositions();
	
		}
	
	
	
		/**
	
		 * 转换到表单数据格式
	
		 */
	
		public java.util.Map<String, String> toFormData() throws com.sh_lianjing.serialize.json.jackson.exception.JsonException{
	
			return com.sh_lianjing.web.util.Util_Form.beanToFormDataFormat(this);
	
		}
	
	
	
	}
	
	
	
	static public class Relation
	{
		public static java.util.Map<String, java.util.List<?>> relations(
			java.util.List<bairui.international.model.domain.jpa.TB_Department> departments
	,		java.util.List<bairui.international.model.domain.jpa.TB_Position> positions
		){
			java.util.Map<String, java.util.List<?>> map = new java.util.HashMap<>();
				map.put(bairui.international.model.domain.jpa.FTB_Admin.departments.Name, departments);
				map.put(bairui.international.model.domain.jpa.FTB_Admin.positions.Name, positions);
			return map;
		}
	}
	
	
	
	/**
	 * 输出模型
	 */
	

}
